<?php

    namespace App\Providers;

    use Illuminate\Support\ServiceProvider;
    use Laravel\Passport\Bridge\PersonalAccessGrant;
    use League\OAuth2\Server\AuthorizationServer;

    class AppServiceProvider extends ServiceProvider {
        /**
         * Register any application services.
         *
         * @return void
         */
        public function register() {
            //
        }

        /**
         * Bootstrap any application services.
         *
         * @return void
         */
        public function boot() {
            //PT120S 设置token 120秒过期
            $this->app->get(AuthorizationServer::class)
                ->enableGrantType(new PersonalAccessGrant(), new \DateInterval('PT120S'));
        }
    }
